﻿using GrainManage.Entities.District;
using GrainManage.Proxy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace GrainManage.Web.Controllers
{
    public class DistrictController : BaseController
    {
        [HttpPost]
        public ActionResult GetChildDistrict(int districtID)
        {
            var inputPara = new InputGetChild
            {
                Authentication = CurrentAccount,
                PageIndex = 0,
                PageSize = int.MaxValue,
                DistrictID = districtID
            };
            var districtProxy = ObjectFactory.DistrictProxy;
            var result = districtProxy.GetChild(inputPara);
            return PartialView(Constant.DropDownListView, result.Districts.Select(m => { return m.Name; }));
        }
    }
}
